Class NewsSentimentProcessorTest

java.lang.Object
com.fsf.news.processor.NewsSentimentProcessorTest

@ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class) class NewsSentimentProcessorTest extends Object
Unit tests for the NewsSentimentProcessor class.
  • Field Details

    • processor

      @InjectMocks com.fsf.news.processor.NewsSentimentProcessor processor
    • config

      @Mock com.typesafe.config.Config config
  • Constructor Details

    • NewsSentimentProcessorTest

      NewsSentimentProcessorTest()
  • Method Details

    • testProcessSentimentNoArticles

      @Test void testProcessSentimentNoArticles()
      Tests that an empty list of articles yields an overall neutral sentiment.
    • testProcessSentimentHappy

      @Test void testProcessSentimentHappy()
      Tests that a list of a single article with a happy description yields an overall happy sentiment.
    • testProcessSentimentSad

      @Test void testProcessSentimentSad()
      Tests that a list of a single article with a sad description yields an overall sad sentiment.
    • testProcessSentimentNeutralThresholdHappy

      @Test void testProcessSentimentNeutralThresholdHappy()
      Tests that a list of a single article with a not enough happy description yields an overall neutral sentiment.
    • testProcessSentimentNeutralThresholdSad

      @Test void testProcessSentimentNeutralThresholdSad()
      Tests that a list of a single article with a not enough sad description yields an overall neutral sentiment.
    • testProcessSentimentNeutral

      @Test void testProcessSentimentNeutral()
      Tests that a list of a single article with a neutral description yields an overall neutral sentiment.
    • testProcessSentimentAverageNeutral

      @Test void testProcessSentimentAverageNeutral()
      Tests that a list of a two articles with a varying descriptions yields an overall neutral sentiment.